﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ESRI.ArcGIS.ADF.BaseClasses;
using PlanningGIS.Framework;
using System.Drawing;
using ESRI.ArcGIS.Geometry;

namespace PlanningGIS.Product
{
    /// <summary>
    /// Blob转FTP
    /// </summary>
    public class Blob2FTPCmd : BaseCommand
    {
        /// <summary>
        /// 
        /// </summary>
        IApplication m_Application = null;
       
        /// <summary>
        /// 
        /// </summary>
        public Blob2FTPCmd()
        {
            base.m_caption = "Blob转FTP";
            base.m_toolTip = base.m_caption;
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="hook"></param>
        public override void OnCreate(object hook)
        {
            if (m_Application == null)
            {
                m_Application = hook as IApplication;
            }
        }
        /// <summary>
        /// 
        /// </summary>
        public override void OnClick()
        {
            if (m_Application == null)
                return;
            FrmBlob2FTP frm = new FrmBlob2FTP();
            frm.Show();
        }
        /// <summary>
        /// 
        /// </summary>
        public override bool Enabled
        {
            get
            {
                if (m_Application == null)
                    return false;
                return (m_Application as IFramework).IsMapCtrlactive;
            }
        }
        /// <summary>
        /// 
        /// </summary>
        public override int Bitmap
        {
            get
            {
                string bitmapResourceName = "PlanningGIS.Product.Resources." + this.GetType().Name + ".ico";
                System.IO.Stream pStream = GetType().Assembly.GetManifestResourceStream(bitmapResourceName);
                if (pStream == null) return 0;
                return new Bitmap(pStream).GetHbitmap().ToInt32();
            }
        }

    }
}
